package com.lc.luzhengtang.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.lc.luzhengtang.R;
import com.lc.luzhengtang.base.BaseActivity;
import com.lc.luzhengtang.event.EventBus;
import com.lc.luzhengtang.event.Info_Liuyan;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/7/10.
 */
public class LiuyanActivity extends BaseActivity {

    @BindView(R.id.img_news)
    ImageView imgNews;
    @BindView(R.id.edittext_nickName)
    EditText edittextNickName;
    @BindView(R.id.btn_register)
    Button btnRegister;
    @BindView(R.id.text_liuyan)
    TextView textLiuyan;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_liuyan);
        ButterKnife.bind(this);
    }

    @OnClick({R.id.img_news, R.id.edittext_nickName, R.id.btn_register, R.id.text_liuyan})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.img_news:
                finish();
                break;
            case R.id.edittext_nickName:
                break;
            case R.id.btn_register:
           /* Intent intent = new Intent();

                intent.putExtra("liuyan", edittextNickName.getText().toString().trim());

                intent.setClass(LiuyanActivity.this, ConfirmOrderActivity.class);

                setResult(1000);
                finish();*/
//                EventBus.getInstance().post(edittextNickName.getText().toString().trim(),edittextNickName.getText().toString());
                EventBus.getInstance().post(new Info_Liuyan(edittextNickName.getText().toString().trim(), ""));
                finish();
                break;

            case R.id.text_liuyan:
//                EventBus.getInstance().post(edittextNickName.getText().toString().trim());
                EventBus.getInstance().post(new Info_Liuyan(edittextNickName.getText().toString().trim(), ""));
                finish();

                break;
        }
    }

}
